<%@ page language="java" contentType="text/html; charset=utf-8" 
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>微博</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Great Taste Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
		function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- js -->
<script src="js/jquery-1.11.1.min.js"></script>
<!-- //js -->
<link
	href='http://fonts.useso.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic'
	rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Great+Vibes'
	rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Comfortaa:400,300,700'
	rel='stylesheet' type='text/css'>

<script type="text/javascript">
function del(id){
	//alert("aaaaaa");
	//alert(id);
	$.ajax(
	{
		url:"deletesvl?id="+id,	
		type:"GET",
		dataType:"text",
		success:function(data){
			if(data == "ok"){
			alert("删除成功！");
			location.reload();
			}
			if(data == "error"){
			alert("删除失败！");
			}
		}
	}
	);
}
function focus(){
	alert("${msg}");	
}
</script>
</head>

<body>
<!-- banner-body -->
<div class="banner-body">
	<div class="container">
		<div class="banner-body-content">
			<div class="col-xs-3 banner-body-left">
				<div class="logo">
					<%/*
				String img = (String)session.getAttribute("img");				
				String name=(String)session.getAttribute("loginName");
				if(name == null){
					out.print("<h1><a href='index.html'>My <span>Weibo</span></a></h1>	");
				}else{
					out.print("<img src='"+img+"'>");
					
					
				}
				*/
				%>

					<c:if test="${ empty loginName}">
						<h1>
							<a href='index.jsp'>My <span>Weibo</span></a>
						</h1>
					</c:if>
					<c:if test="${not empty loginName}">
						<img src="${img}">
					</c:if>
				</div>
				<div class="top-nav">
					<nav class="navbar navbar-default">
						<!-- Brand and toggle get grouped for better mobile display -->
						<div class="navbar-header">
							<button type="button" class="navbar-toggle collapsed"
								data-toggle="collapse"
								data-target="#bs-example-navbar-collapse-1">
								<span class="sr-only">Toggle navigation</span> <span
									class="icon-bar"></span> <span class="icon-bar"></span> <span
									class="icon-bar"></span>
							</button>
						</div>

						<!-- Collect the nav links, forms, and other content for toggling -->
						<div class="collapse navbar-collapse nav-wil"
							id="bs-example-navbar-collapse-1">
							<nav class="stroke">
								<ul class="nav navbar-nav">
									<li class="active"><a href="#"><i
											class="home"></i>Home</a></li>


									<%
									/*
									name=(String)session.getAttribute("loginName");	
									if(name == null){
									//int id=(int)session.getAttribute("userId");								
									//if(id == 0){
									//if((int)session.getAttribute("userId") == 0){	
									out.print("<li><a href='login.jsp' class='hvr-underline-from-left'><i class='text-size1'></i>登录</a></li>");
									out.print("<li><a href='zhuce.jsp' class='hvr-underline-from-left'><i class='envelope1'></i>注册</a></li>");
									}
									else{
									out.print("<li><a href='userInfosvl' class='hvr-underline-from-left'><i class='edit1'></i>修改个人信息</a></li>");
									out.print("<li><a href='publish.jsp' class='hvr-underline-from-left'><i class='picture1'></i>发布微博</a></li>");
									out.print("<li><a href='index.jsp' class='hvr-underline-from-left'><i class='text-size1'></i>刷新</a></li>");
									out.print("<li><a href='out.jsp' class='hvr-underline-from-left'><i class='text-size1'></i>退出登录</a></li>");
									}
									*/
									 %>
									<c:if test="${empty loginName}">
										<c:if test="${empty userId }">
											<li><a href='login.jsp' class='hvr-underline-from-left'><i
													class='text-size1'></i>登录</a></li>
											<li><a href='zhuce.jsp' class='hvr-underline-from-left'><i
													class='envelope1'></i>注册</a></li>
										</c:if>
									</c:if>
									<c:if test="${not empty loginName}">
										<li><a href='userInfosvl' class='hvr-underline-from-left'><i
												class='edit1'></i>修改个人信息</a></li>
										<li><a href='publish.jsp' class='hvr-underline-from-left'><i
												class='picture1'></i>发布微博</a></li>
										<li><a href='myFocussvl' class='hvr-underline-from-left'><i
												class='picture1'></i>我的关注</a></li>
										<li><a href='index.jsp' class='hvr-underline-from-left'><i
												class='text-size1'></i>刷新</a></li>
										<li><a href='logoutsvl' class='hvr-underline-from-left'><i
												class='text-size1'></i>退出登录</a></li>
									</c:if>



								</ul>
							</nav>
						</div>
						<!-- /.navbar-collapse -->
					</nav>
				</div>
			</div>
			<div class="col-xs-9 banner-body-right">
				<div class="wmuSlider example1">
					<div class="wmuSliderWrapper">
						<article style="position: absolute; width: 100%; opacity: 0;">
							<div class="banner-wrap">
								<div class="banner"></div>
							</div>
						</article>
						<article style="position: absolute; width: 100%; opacity: 0;">
							<div class="banner-wrap">
								<div class="banner1"></div>
							</div>
						</article>
						<article style="position: absolute; width: 100%; opacity: 0;">
							<div class="banner-wrap">
								<div class="banner2"></div>
							</div>
						</article>
					</div>
				</div>
				<script src="js/jquery.wmuSlider.js"></script>
				<script>
						$('.example1').wmuSlider();       
					 </script>
				<c:forEach items="${weibo }" var="aa">
					<div class="banner-bottom">
						<div class="col-md-4 banner-left">
							<div class="col-xs-3 banner-left1">

								<div class="banner-left11">
									<span> </span>
								</div>
							</div>
							<div class="col-xs-9 banner-right1">
								<h3>
									${aa.nickname}
								
									<c:if test="${ aa.level==1}">v</c:if>
									<!-- 
									<c:if test="${aa.forward==1 }">
										<c:forEach items="${ forwordlist}" var="forword">									
										@${forword.nickname }										
										</c:forEach>
									</c:if>
									 -->
								</h3>
							</div>

							<div class="clearfix"></div>
							<p>${aa.text }</p>
							<div align="right">
								<c:if test="${not empty userId }">
									<c:if test="${aa.agree != 0 }">
										<a href="agreesvl?id=${aa.id }&userid=${aa.userid}">点赞+${aa.agree}</a>
									</c:if>
									<c:if test="${aa.agree == 0 }">
										<a href="agreesvl?id=${aa.id }&userid=${aa.userid}">点赞</a>
									</c:if>
								</c:if>
								<c:if test="${not empty userId }">
									<a href="forwordsvl?userid=${userId }&weiboid=${aa.id}">转发</a>
								</c:if>
								<c:if test="${aa.userid == userId and not empty userId }">
									<a onclick="del(${aa.id })" href="#">删除</a>
								</c:if>
								<c:set var="flag" value="false" scope="page" />


								<c:forEach items="${ focusList}" var="focus">
									<c:if
										test="${aa.userid != userId and not empty userId and focus.targetid == aa.userid}">
										<c:set var="flag" value="true" scope="page" />
										<a
											href="unFocussvl?weiboUserid=${aa.userid}&loginUserid=${userId}">取关</a>
									</c:if>
								</c:forEach>


								<c:if
									test="${aa.userid != userId and not empty userId and flag == false}">
									<a
										href="focussvl?weiboUserid=${aa.userid}&loginUserid=${userId}">关注</a>
								</c:if>


							</div>
						</div>

					</div>
					<div class="clearfix"></div>
				</c:forEach>
				<script src="js/bootstrap.js"></script>

</body>
</html>